//
//  AppDelegate.m
//  UI_821
//
//  Created by 闫潇 on 14-8-21.
//  Copyright (c) 2014年 xian. All rights reserved.
//

#import "AppDelegate.h"
//#import "Person.h"
//#import "LianJia.h"
//#import "IHome.h"
//#import "RentDelegate.h"
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    
    UITextField * tf1 = [[UITextField alloc]initWithFrame:CGRectMake(40, 100, 120, 40)];
//    [tf1 setBorderStyle:UITextBorderStyleLine];
    [tf1 setPlaceholder:@"我是占位符"];
//    通过私有方法KVC访问私有成员
    [tf1 setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
//    设置文本框文字，当文本框内出现文字时，占位符消失
//    [tf1 setText:@"我是文字"];
    //设置文本框的背景图
    //1.将图片加载到内存中,除了png必须要后缀
    UIImage * bgImage = [UIImage imageNamed:@"1@2x.jpg"];
    [tf1 setBackground:bgImage];
    [tf1 setTextAlignment:NSTextAlignmentCenter];
    [self.window addSubview:tf1];
    
    
    [tf1  setDelegate:self];
    
//    Person * p =[Person new];
//    p.name=@"道斌";
//    
//    IHome * i = [IHome new];
//    p.rentDelegate=i;
//    
////    [p.rentDelegate findHouseForPerson:p];
//
//    [p findHouse];
//    
    
//    
//    UISlider  * slider = [[UISlider alloc]initWithFrame:CGRectMake(30, 200, 200, 30)];
//    
    
    
    UIAlertView * alert1 = [[UIAlertView alloc]initWithTitle:@"ttttilte" message:@"MMMMMesaseage" delegate:self cancelButtonTitle:@"cang" otherButtonTitles:@"other1",@"2",@"3", nil];
    [alert1 setAlertViewStyle:UIActivityTypePostToWeibo];
    [alert1 show];
    
    
    UIActionSheet * sheet = [[UIActionSheet alloc]initWithTitle:@"标题" delegate:@"大师兄" cancelButtonTitle:@"二师兄" destructiveButtonTitle:@"三师弟" otherButtonTitles:
    @"师傅", nil];
    [sheet showInView:self.window];
    
    UIDatePicker * datePicker = [UIDatePicker alloc]initWithFrame:<#(CGRect)#>
    
    
    return YES;
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSLog(@"索引值%d");
}
-(void)textFieldDidBeginEditing:(UITextField *)textField
{
    NSLog(@"开始文本编辑");
}
-(BOOL)textFielShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

@end
